import request from '@/store/request'

// 获取所有用户
export function allUsers (form) {
  return request({
    url: 'user/combox',
    method: 'POST',
    dataType: 'josn',
    data: form
  })
}

// 新增用户
export function insertUsers (form) {
  return request({
    url: 'user/insert',
    method: 'POST',
    dataType: 'josn',
    data: form
  })
}
// 分页查询
export function pageUsers (form) {
  return request({
    url: 'user/page',
    method: 'POST',
    dataType: 'josn',
    data: form
  })
}
// 解除用户企业绑定
export function unBindUserEnterprise (userId) {
  return request({
    url: 'user/deleteUser/' + userId,
    method: 'get',
    dataType: 'josn'
  })
}
// 通过用户手机号查询
export function findByMobile (userId) {
  return request({
    url: 'user/findByMobile/' + userId,
    method: 'get',
    dataType: 'josn'
  })
}

// 锁定,解除锁定
export function lockedOrNot (userId) {
  return request({
    url: 'user/updateStatus/' + userId,
    method: 'get',
    dataType: 'josn'
  })
}

export function loadMobileUserDatas (params) {
  return request({
    url: 'user/normal/user',
    method: 'get',
    dataType: 'json',
    params: params
  })
}
